/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ronsicecream.pos.entities;

import com.buanalintas.bynga.entities.MasterUnit;
import com.buanalintas.bynga.entities.MasterUser;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author user
 */
@Entity
@Table(name = "pos_transaction_ho_retur_to_supplier")
@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "PosTransactionHoReturToSupplier.findAll", query = "SELECT p FROM PosTransactionHoReturToSupplier p"),
//    @NamedQuery(name = "PosTransactionHoReturToSupplier.findBySync", query = "SELECT p FROM PosTransactionHoReturToSupplier p WHERE p.sync = :sync"),
//    @NamedQuery(name = "PosTransactionHoReturToSupplier.findByReturId", query = "SELECT p FROM PosTransactionHoReturToSupplier p WHERE p.returId = :returId"),
//    @NamedQuery(name = "PosTransactionHoReturToSupplier.findByReturDate", query = "SELECT p FROM PosTransactionHoReturToSupplier p WHERE p.returDate = :returDate"),
//    @NamedQuery(name = "PosTransactionHoReturToSupplier.findByReturNumber", query = "SELECT p FROM PosTransactionHoReturToSupplier p WHERE p.returNumber = :returNumber"),
//    @NamedQuery(name = "PosTransactionHoReturToSupplier.findByReturQuantity", query = "SELECT p FROM PosTransactionHoReturToSupplier p WHERE p.returQuantity = :returQuantity"),
//    @NamedQuery(name = "PosTransactionHoReturToSupplier.findByReturTimestamp", query = "SELECT p FROM PosTransactionHoReturToSupplier p WHERE p.returTimestamp = :returTimestamp")})
public class PosTransactionHoReturToSupplier implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "retur_id")
    private Integer returId;
    @Column(name = "retur_date")
    @Temporal(TemporalType.DATE)
    private Date returDate;
    @Column(name = "retur_number")
    private String returNumber;
    @Column(name = "retur_quantity")
    private BigDecimal returQuantity;
    @Lob
    @Column(name = "retur_description")
    private String returDescription;
    @Column(name = "retur_timestamp")
    @Temporal(TemporalType.TIMESTAMP)
    private Date returTimestamp;
    @JoinColumn(name = "retur_receipt_id", referencedColumnName = "receipt_id")
    @ManyToOne
    private PosTransactionHoReceiptFromSupplier returReceiptId;
    @JoinColumn(name = "retur_pos_unit_id", referencedColumnName = "unit_id")
    @ManyToOne
    private PosMasterUnit returPosUnitId;
    @JoinColumn(name = "retur_supplier_id", referencedColumnName = "supplier_id")
    @ManyToOne(optional = false)
    private PosMasterSupplier returSupplierId;
    @JoinColumn(name = "retur_regional_id", referencedColumnName = "regional_id")
    @ManyToOne(optional = false)
    private PosMasterRegional returRegionalId;
    @JoinColumn(name = "retur_user_id", referencedColumnName = "user_id")
    @ManyToOne
    private MasterUser returUserId;
    @JoinColumn(name = "retur_unit_id", referencedColumnName = "unit_id")
    @ManyToOne
    private MasterUnit returUnitId;
    
    public PosTransactionHoReturToSupplier() {
    }

    public PosTransactionHoReturToSupplier(Integer returId) {
        this.returId = returId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getReturId() {
        return returId;
    }

    public void setReturId(Integer returId) {
        this.returId = returId;
    }

    public Date getReturDate() {
        return returDate;
    }

    public void setReturDate(Date returDate) {
        this.returDate = returDate;
    }

    public String getReturNumber() {
        return returNumber;
    }

    public void setReturNumber(String returNumber) {
        this.returNumber = returNumber;
    }

    public String getReturDescription() {
        return returDescription;
    }

    public void setReturDescription(String returDescription) {
        this.returDescription = returDescription;
    }

    public Date getReturTimestamp() {
        return returTimestamp;
    }

    public void setReturTimestamp(Date returTimestamp) {
        this.returTimestamp = returTimestamp;
    }

    public PosTransactionHoReceiptFromSupplier getReturReceiptId() {
        return returReceiptId;
    }

    public void setReturReceiptId(PosTransactionHoReceiptFromSupplier returReceiptId) {
        this.returReceiptId = returReceiptId;
    }

    public PosMasterUnit getReturPosUnitId() {
        return returPosUnitId;
    }

    public void setReturPosUnitId(PosMasterUnit returPosUnitId) {
        this.returPosUnitId = returPosUnitId;
    }

    public BigDecimal getReturQuantity() {
        return returQuantity;
    }

    public void setReturQuantity(BigDecimal returQuantity) {
        this.returQuantity = returQuantity;
    }

    public PosMasterSupplier getReturSupplierId() {
        return returSupplierId;
    }

    public void setReturSupplierId(PosMasterSupplier returSupplierId) {
        this.returSupplierId = returSupplierId;
    }

    public PosMasterRegional getReturRegionalId() {
        return returRegionalId;
    }

    public void setReturRegionalId(PosMasterRegional returRegionalId) {
        this.returRegionalId = returRegionalId;
    }

    public MasterUser getReturUserId() {
        return returUserId;
    }

    public void setReturUserId(MasterUser returUserId) {
        this.returUserId = returUserId;
    }

    public MasterUnit getReturUnitId() {
        return returUnitId;
    }

    public void setReturUnitId(MasterUnit returUnitId) {
        this.returUnitId = returUnitId;
    }


    @Override
    public int hashCode() {
        int hash = 0;
        hash += (returId != null ? returId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosTransactionHoReturToSupplier)) {
            return false;
        }
        PosTransactionHoReturToSupplier other = (PosTransactionHoReturToSupplier) object;
        if ((this.returId == null && other.returId != null) || (this.returId != null && !this.returId.equals(other.returId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ronsicecream.pos.entities.PosTransactionHoReturToSupplier[ returId=" + returId + " ]";
    }
    
}
